<?php
/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Core
 * @package    Core_Auth
 * @subpackage Core_Auth_Adapter
 */

/**
 * @see Zend_Auth_Adapter_Interface
 */
require_once 'Zend/Auth/Adapter/DbTable.php';
require_once 'Core/Resource.php';

/**
 * This is a concrete implementation of the Core Auth DBTable adapter
 * that is linked to the internal resources of the core data model.
 *
 * @category   Core
 * @package    Core_Auth
 * @subpackage Core_Auth_Adapter
 */
class Core_Auth_Adapter_DbTable extends Zend_Auth_Adapter_DbTable {
	
	public function __construct()
	{
		parent::__construct(Core_Resource::locate('db'));
		
		$this->setTableName ( "user" );
		$this->setIdentityColumn ( 'email' );
		$this->setCredentialColumn ( 'password' );
		$this->setCredentialTreatment( "SHA1( CONCAT( ?, salt ) )");
	}
}
